﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace WpfCanvas
{
    /// <summary>
    /// Grid.xaml 的交互逻辑
    /// </summary>
    public partial class Grid : Window
    {
        public Grid()
        {
            InitializeComponent();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            
            
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            MessageBox.Show("   ");
            RowDefinition row1 = new RowDefinition();   //实例化一个Grid行
            ColumnDefinition co1 = new ColumnDefinition();    //实例化一个Grid列
            mainGrid.RowDefinitions.Add(row1);
            mainGrid.ColumnDefinitions.Add(co1);
            //for (int i = 0; i < 10; i++)
            //{
            //    Grid g = new Grid();
            //    this.mainGrid.Children.Add(g);
            //}
        }
    }
}
